from src.common.logger import getLogger
from langchain_ollama import ChatOllama

logger = getLogger()

class LanguageModel:

    def __init__(self, model_name, base_url, api_key):
        self.model_name = model_name
        self.base_url = base_url
        self.api_key = api_key

    def new_llm_model(self):
        llm = ChatOllama(
            base_url = self.base_url,
            model = self.model_name,
            temperature = 0.1
        )
        logger.info(f"LanguageModel new_llm_model: {self.model_name}")
        return llm
